package com.googlecode.loframework.view.components.quizzes
{
	import com.googlecode.loframework.core.NotificationNames;
	import com.googlecode.loframework.model.QuizProxy;
	import com.googlecode.loframework.view.IComponent;
	
	import flash.events.Event;
	
	import org.puremvc.as3.interfaces.INotification;
	
	public class QuizResultsMediator extends QuizMediator
	{
		/**
		 * Identifier. This is made unique by the addition of a number at its end.
		 * QuizResultsMediator components have to be registered dynamically. 
		 */
		private var _name:String = "QuizResultsMediator";
		 
		/**
		 * Constructor 
		 * @param viewComponent
		 * 
		 */
		public function QuizResultsMediator(viewComponent:IComponent)
		{
			super(_name, viewComponent);
		}
		
		override public function onRegister():void
		{
			super.onRegister();

			var proxy:QuizProxy = facade.retrieveProxy(QuizProxy.NAME) as QuizProxy;

			viewRef.results = proxy.questionList;
		}
		
		
		protected function get viewRef():QuizResults
		{
			return viewComponent as QuizResults;
		}
	}
}